Cameras are commonly used as a surveillance tool or as a tool for assisting persons in different situations. For example, cameras may be used for traffic surveillance or traffic assistance purposes. A camera may for instance be mounted on a car or on a train in order to assist the driver or provide input to an auto-pilot or safety system.
During night time a problem with saturation of pixels in the images captured by the camera may arise if a strong light source enters the scene. Saturation is due to the fact that the limited dynamics of the pixels in the camera sensor makes it impossible to capture the entire range of light intensities. As a result it may for instance be difficult to see the colour of signals, such as traffic lights and railway signals, during night time. It may also be difficult to distinguish the numbers on a license plate since light reflected by a license plate may cause saturation in the image.
For the surveillance purposes exemplified above it is thus important not to saturate any parts of the image during night time. At the same time it does not matter if parts of the image are saturated during day time when the sun often causes saturation in the images and therefore the brightest part of the scene usually is the sky which is not that important from a surveillance point of view.
The patent with publication number U.S. Pat. No. 7,474,847 B2 discloses exposure control of a camera based on intensity histograms from image frames. In more detail, characteristic values, such as a mean value, a lower limit and an upper limit, are extracted from the histogram. Exposure parameters of the camera are then adjusted until the characteristic values of the histogram reaches some predefined target levels. The target levels may be varied in accordance with the ambient light level, such that the target levels are decreased when it is dark. As a result, the histogram of images captured when it is dark will be shifted towards the darker end of the intensity range, thereby likely decreasing the number of saturated pixels in the images. This shift makes the images appear underexposed. However, a drawback with this method is that the images will always be underexposed when it is dark, regardless of whether there is saturation in the images or not. For example, the images will be underexposed even if there are no traffic lights in the scene at night time. There is thus room for improvements.